package other.barcode.test;

import java.util.ArrayList;
import java.util.List;

/**
 * @author bingo
 * @Description
 * @Date 2018/7/24
 */
public class Main {

    public static void main(String[] args) {

        try {
            DatabaseSave databaseSave  = (DatabaseSave) Class.forName("other.barcode.test.DatabaseSave").newInstance();
            FileSystemSave fileSystemSave  = (FileSystemSave) Class.forName("other.barcode.test.FileSystemSave").newInstance();
            List<SaveService> lists = new ArrayList<>();
            lists.add(databaseSave);
            lists.add(fileSystemSave);
            for(SaveService saveService:lists){

               saveService.save();
               saveService.release();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
